import Vue from 'vue'
import Router from 'vue-router'
import Login from '../components/login.vue'
import Home from '../components/Home.vue'
import Chat from '../page/chat/chat.vue'
import Friend from '../page/friend/friend.vue'
import My from '../page/resume/resume.vue'
import File from '../page/file/file.vue'
import Change from '../page/change/change.vue'

Vue.use(Router)

const router = new Router({
  routes: [{
      path: '/',
      redirect: '/login'
    },
    {
      path: '/login',
      component: Login
    },
    {
      path: '/home',
      component: Home,
      redirect: '/chat',
      children: [{
          path: '/chat',
          component: Chat
        },
        {
          path: '/friend',
          component: Friend
        },
        {
          path: '/my',
          component: My
        },
        {
          path: '/file',
          component: File
        },
        {
          path: '/change',
          component: Change
        },
      ]
    }
  ],
  linkActiveClass: 'active'
})
router.push({
  path: '/login'
});
export default router
